using System.Collections.Generic;

namespace KlearStorage
{
    public class ValidationDictionary : IValidationDictionary
    {
        public class Error
        {
            public string Key { get; set; }
            public string Message { get; set; }
        }

        private readonly IList<Error> _errors = new List<Error>();

        public IList<Error> Errors { get { return _errors; } }

        public bool IsValid
        {
            get { return _errors.Count == 0; }
        }


        public void AddModelError(string key, string errorMessage)
        {
            _errors.Add(new Error { Key = key, Message = errorMessage });
        }
    }
}